﻿@model IEnumerable<ElectronicDiary.ViewModels.Admin.Subject>
@{
    ViewBag.Title = "Edycja Przedmiotów";
}

<h2>Edycja Przedmiotów</h2>

@Html.Action("Menu")

<table class="tablesorter">
    <thead>
        <tr>
            <th>
                ID           
            </th>
            <th>
                Nazwa
            </th>
        </tr>
    </thead>
    <tbody>
        @{
            int i = 1;
            foreach (var item in Model)
            {
                <tr>
                    <td>@i</td>
                    <td>@item.Name</td>
                    <td style="width: 40px;">
                        @Html.ActionLink("Edycja", "SubjectEdit", "Admin", new { id = item.ID }, null)                        
                    </td>
                </tr>
                i++;
            }
        }
    </tbody>
    <tfoot>
        <tr>
            <td>
                @Html.ActionLink("Dodaj Przedmiot", "SubjectAdd", "Admin")
            </td>
            <td colspan="4">
                <div id="pager" style="margin-left: auto; margin-right: auto; width: 200px;">
                    <form>
                    <img src="@Url.Content("~/Content/images/first.png")" class="first" />
                    <img src="@Url.Content("~/Content/images/prev.png")" class="prev" />
                    <input type="text" class="pagedisplay" disabled="disabled" style="width: 50px; text-align: center;"/>
                    <img src="@Url.Content("~/Content/images/next.png")" class="next" />
                    <img src="@Url.Content("~/Content/images/last.png")" class="last" />
                    <select class="pagesize">
                        <option selected="selected" value="5">5</option>
                        <option value="10">10</option>
                        <option value="20">20</option>
                        <option value="30">30</option>
                        <option value="40">40</option>
                    </select>
                    </form>
                </div>                
            </td>
        </tr>
    </tfoot>     
</table>

<script type="text/javascript">
    $(function () {
        $("table.tablesorter").tablesorter({ widthFixed: true, sortList: [[0, 0]] })
            .tablesorterPager({ container: $("#pager"), size: $(".pagesize option:selected").val() });
    }); ;
</script>
